home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WCOLRDLG_HPP_INCLUDED
- #define _WCOLRDLG_HPP_INCLUDED
- #pragma once
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WCOLOR_HPP_INCLUDED
- # include "wcolor.hpp"
- #endif
- #ifndef _WCOMDLG_HPP_INCLUDED
- # include "wcomdlg.hpp"
- #endif
- #ifndef _WARRAY_HPP_INCLUDED
- # include "warray.hpp"
- #endif
-
- typedef WArray< WColor > WColorArray;
-
- //
- // ColorDialog styles
- //
-
- typedef WULong WCDStyle;
-
- #define WCDSRGBInit ((WCDStyle)0x00000001L) // CC_RGBINIT
- #define WCDSFullOpen ((WCDStyle)0x00000002L) // CC_FULLOPEN
- #define WCDSPreventFullOpen ((WCDStyle)0x00000004L) // CC_PREVENTFULLOPEN
- #define WCDSShowHelp ((WCDStyle)0x00000008L) // CC_SHOWHELP
- #define WCDSEnableHook ((WCDStyle)0x00000010L) // CC_ENABLEHOOK
- #define WCDSEnableTemplate ((WCDStyle)0x00000020L) // CC_ENABLETEMPLATE
- #define WCDSEnableTemplateHandle ((WCDStyle)0x00000040L) // CC_ENABLETEMPLATEHANDLE
- #define WCDSSolidColor ((WCDStyle)0x00000080L) // CC_SOLIDCOLOR
- #define WCDSAnyColor ((WCDStyle)0x00000100L) // CC_ANYCOLOR
-
- // WColorDialog
- //
- // Used to display color dialog.
-
- class WCMCLASS WColorDialog : public WCommonDialog {
- WDeclareSubclass( WColorDialog, WCommonDialog );
-
- public:
-
- /*******************************************************
- * Constructors and Destructors
- *******************************************************/
-
- WColorDialog();
-
- ~WColorDialog();
-
- /*******************************************************
- * Properties
- *******************************************************/
-
- // Color
-
- WColor GetColor() const;
- WBool SetColor( const WColor & color );
-
- // CustomColorList
- //
- // Set the list of colors to use in the custom color
- // section of the dialog. The list of colors is an
- // array of 16 WColor objects. The colors will be
- // modified as necessary and so must be read-write.
-
- #define WCD_NUM_COLORS 16
-
- WColorArray GetCustomColorList() const;
- WBool SetCustomColorList( const WColorArray & list );
-
- // Style
- //
- // Set the styles used by the file dialog. Note that
- // the WCDSEnableHook style will ALWAYS be enabled.
-
- WCDStyle GetStyle() const;
- WBool SetStyle( WCDStyle style );
-
- /*******************************************************
- * Methods
- *******************************************************/
-
- // ChangeStyle
- //
- // Use to turn a specific style on or off.
-
- WBool ChangeStyle( WCDStyle style, WBool on );
-
- // Prompt
- //
- // Display the dialog and wait for it to be dismissed.
- // The first form uses the current settings. The second
- // is a convenience function.
-
- WBool Prompt();
-
- WBool Prompt( WWindow * owner, const WChar * title );
-
- /************************************************************
- * Notifications
- ************************************************************/
-
- void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
-
- /************************************************************
- * Others
- ************************************************************/
-
- protected:
-
- virtual void *PackCC();
- virtual WBool UnpackCC( WBool ok );
-
- /************************************************************
- * Data members
- ************************************************************/
-
- protected:
-
- void * _cc;
- WULong _customColors[ 16 ];
- WColorArray _colorList;
- WColor _color;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WCOLRDLG_HPP_INCLUDED
-